import React from 'react'
import { Router, Route, Switch } from 'react-router-dom'
// import Layout from "./pages/Layout/idnex.js"
// import Login from "./pages/Login/index.js"
// import Test from './pages/Test/index.js'
import AuthRouter from "components/AuthRouter.js"
import 'antd/dist/antd.css'
import history from 'utils/history.js'
const Layout = React.lazy(() => import("./pages/Layout/idnex.js"))
const Login = React.lazy(() => import("./pages/Login/index.js"))
const Test = React.lazy(() => import("./pages/Test/index.js"))
export default class App extends React.Component {
  render() {
    return (

      <Router history={history}>
        <React.Suspense fallback={<div>懒加载,,,,</div>}>
          <Switch>
            {/* <Route path="/Layout" component={Layout}></Route> */}
            <Route path="/test" component={Test}></Route>
            <AuthRouter path='/layout' component={Layout}></AuthRouter>
            <Route exact path="/" component={Login}></Route>
          </Switch>
        </React.Suspense>

      </Router>
    )
  }
}